<?php
namespace App\Http\Controllers\Home;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
//use App\Help\Help;
class UserController extends Controller
{
	public function register(Request $request)
	{
		$data['username'] = $request->get('username');
		$data['sex'] = $request->get('sex');
		//$data['age'] = Help::getAge($request->get('age'));
		$data['birthday'] = strtotime($request->get('birthday'));
		$data['password'] = md5($request->get('password'));
		$result = DB::table('user')->insert($data);
		if($result){
			return response()->json(['status'=>1,'code'=>'success']);
		}else{
			return response()->json(['status'=>0,'code'=>'error']);
		}
		
	}
}